<template>
  <div class="container">
    <Breadcrumb :items="['生产管理', '钣金版本模块零件']" />
    <a-card class="general-card">

      <template #title>
        <span>产品系列</span>
        <a-tree-select
                :data="datatree"
                v-model="formModel.selected"
                placeholder="Please select ..."
                style="width: 300px"
                @change="onChange"
        >
        </a-tree-select>

        <a-space>
        模块系列
        <a-select v-model="plateVersion" :options="contentTypeOptionsPlateData" :field-names="fieldNames" :style="{width:'320px'}"
                  @change="onPlateChange"  placeholder="Please select ...">
        </a-select>
        </a-space>

        <a-space>
       模块零件系列
        <a-select v-model="platePartVersion" :options="contentTypeOptionsPlatePartData" :field-names="fieldPartNames" :style="{width:'320px'}"
                  @change="onPlatePartChange"  placeholder="Please select ...">
        </a-select>
        </a-space>

       <!-- <a-space>
        <a-button @click="handleClick" type="primary">添加产品分类</a-button>
        <a-modal v-model:visible="visiblePart" title="添加产品分类" @cancel="handleCancel" @before-ok="handleBeforeOk">
          <a-form :model="formPart">
            <a-form-item field="pid" label="上级产品分类"  >
              <a-tree-select
                      v-model="formPart.pid"
                      :data="renderDataPart"
                      placeholder="请选择上级产品分类"
              />
            </a-form-item>
            <a-form-item field="name" label="产品分类名称">
              <a-input v-model="formPart.name" />
            </a-form-item>
          </a-form>
        </a-modal>
        </a-space>

        <a-space>
        <a-button @click="handleClickProductionEdit" type="primary">修改产品分类</a-button>
        <a-modal v-model:visible="visibleProductionEdit" title="修改产品分类" @cancel="handleCancelProductionEdit" @before-ok="handleBeforeOkProductionEdit">
          <a-form :model="formProductionEdit">
            <a-form-item field="pid" label="上级产品分类"  >
              <a-tree-select
                      v-model="formProductionEdit.pid"
                      :data="renderDataProductionEdit"
                      placeholder="请选择上级产品分类"
              />
            </a-form-item>
            <a-form-item field="name" label="产品分类名称">
              <a-input v-model="formProductionEdit.name" />
            </a-form-item>
          </a-form>
        </a-modal>
        </a-space>

        <a-space>
        <a-button @click="handleClickProductionDelete" type="primary">删除产品分类</a-button>
        <a-modal v-model:visible="visibleProductionDelete" title="删除产品分类" @cancel="handleCancelProductionDelete" @before-ok="handleBeforeOkProductionDelete">
          <a-form :model="formProductionDelete">
            <a-form-item field="pid" label="上级产品分类"  >
              <a-tree-select
                      v-model="formProductionDelete.pid"
                      :data="renderDataProductionDelete"
                      placeholder="请选择上级产品分类"
              />
            </a-form-item>
          </a-form>
        </a-modal>
        </a-space>-->
      </template>

      <!--<a-row>
        <a-col :flex="1">
          <a-form
            :model="formModel"
            :label-col-props="{ span: 6 }"
            :wrapper-col-props="{ span: 18 }"
            label-align="left"
          >
            <a-row :gutter="16">
              <a-col :span="8">
                <a-form-item
                  field="number"
                  :label="$t('searchTable.form.number')"
                >
                  <a-input
                    v-model="formModel.number"
                    :placeholder="$t('searchTable.form.number.placeholder')"
                  />
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item field="name" :label="$t('searchTable.form.name')">
                  <a-input
                    v-model="formModel.name"
                    :placeholder="$t('searchTable.form.name.placeholder')"
                  />
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  field="contentType"
                  :label="$t('searchTable.form.contentType')"
                >
                  <a-select
                    v-model="formModel.contentType"
                    :options="contentTypeOptions"
                    :placeholder="$t('searchTable.form.selectDefault')"
                  />
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  field="filterType"
                  :label="$t('searchTable.form.filterType')"
                >
                  <a-select
                    v-model="formModel.filterType"
                    :options="filterTypeOptions"
                    :placeholder="$t('searchTable.form.selectDefault')"
                  />
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  field="createdTime"
                  :label="$t('searchTable.form.createdTime')"
                >
                  <a-range-picker
                    v-model="formModel.createdTime"
                    style="width: 100%"
                  />
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  field="status"
                  :label="$t('searchTable.form.status')"
                >
                  <a-select
                    v-model="formModel.status"
                    :options="statusOptions"
                    :placeholder="$t('searchTable.form.selectDefault')"
                  />
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </a-col>
        <a-divider style="height: 84px" direction="vertical" />
        <a-col :flex="'86px'" style="text-align: right">
          <a-space direction="vertical" :size="18">
            <a-button type="primary" @click="search">
              <template #icon>
                <icon-search />
              </template>
              {{ $t('searchTable.form.search') }}
            </a-button>
            <a-button @click="reset">
              <template #icon>
                <icon-refresh />
              </template>
              {{ $t('searchTable.form.reset') }}
            </a-button>
          </a-space>
        </a-col>
      </a-row>-->

      <a-divider style="margin-top: 0" />
      <a-row style="margin-bottom: 16px">
        <a-col :span="12">
          <a-space>
            <a-button type="primary" @click="add">
              <template #icon>
                <icon-plus />
              </template>
              {{ $t('searchTable.operation.create') }}
            </a-button>





            <a-upload action="/">
              <template #upload-button>
                <a-button>
                  {{ $t('searchTable.operation.import') }}
                </a-button>
              </template>
            </a-upload>
          </a-space>
        </a-col>
        <a-col
          :span="12"
          style="display: flex; align-items: center; justify-content: end"
        >
          <a-button>
            <template #icon>
              <icon-download />
            </template>
            {{ $t('searchTable.operation.download')}}
          </a-button>
          <a-tooltip :content="$t('searchTable.actions.refresh')">
            <div class="action-icon" @click="search"
              ><icon-refresh size="18"
            /></div>
          </a-tooltip>
          <a-dropdown @select="handleSelectDensity">
            <a-tooltip :content="$t('searchTable.actions.density')">
              <div class="action-icon"><icon-line-height size="18" /></div>
            </a-tooltip>
            <template #content>
              <a-doption
                v-for="item in densityList"
                :key="item.value"
                :value="item.value"
                :class="{ active: item.value === size }"
              >
                <span>{{ item.name }}</span>
              </a-doption>
            </template>
          </a-dropdown>
          <a-tooltip :content="$t('searchTable.actions.columnSetting')">
            <a-popover
              trigger="click"
              position="bl"
              @popup-visible-change="popupVisibleChange"
            >
              <div class="action-icon"><icon-settings size="18" /></div>
              <template #content>
                <div id="tableSetting">
                  <div
                    v-for="(item, index) in showColumns"
                    :key="item.dataIndex"
                    class="setting"
                  >
                    <div style="margin-right: 4px; cursor: move">
                      <icon-drag-arrow />
                    </div>
                    <div>
                      <a-checkbox
                        v-model="item.checked"
                        @change="handleChange($event, item as TableColumnData, index)"
                      >
                      </a-checkbox>
                    </div>
                    <div class="title">
                      {{ item.title === '#' ? '序列号' : item.title }}
                    </div>
                  </div>
                </div>
              </template>
            </a-popover>
          </a-tooltip>
        </a-col>
      </a-row>
      <a-table
        row-key="id"
        :loading="loading"
        :pagination="pagination"
        :columns="(cloneColumns as TableColumnData[])"
        :data="renderDataPartList"
        :bordered="false"
        :size="size"
        @page-change="onPageChange"
      >
        <template #index="{ rowIndex }">
          {{ rowIndex + 1 + (pagination.current - 1) * pagination.pageSize }}
        </template>
        <template #contentType="{ record }">
          <a-space>
            <a-avatar
              v-if="record.contentType === 'img'"
              :size="16"
              shape="square"
            >
              <img
                alt="avatar"
                src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/581b17753093199839f2e327e726b157.svg~tplv-49unhts6dw-image.image"
              />
            </a-avatar>
            <a-avatar
              v-else-if="record.contentType === 'horizontalVideo'"
              :size="16"
              shape="square"
            >
              <img
                alt="avatar"
                src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/77721e365eb2ab786c889682cbc721c1.svg~tplv-49unhts6dw-image.image"
              />
            </a-avatar>
            <a-avatar v-else :size="16" shape="square">
              <img
                alt="avatar"
                src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/ea8b09190046da0ea7e070d83c5d1731.svg~tplv-49unhts6dw-image.image"
              />
            </a-avatar>
            {{ $t(`searchTable.form.contentType.${record.contentType}`) }}
          </a-space>
        </template>
        <template #filterType="{ record }">
          {{ $t(`searchTable.form.filterType.${record.filterType}`) }}
        </template>
        <template #status="{ record }">
          <span v-if="record.status === 'offline'" class="circle"></span>
          <span v-else class="circle pass"></span>
          {{ $t(`searchTable.form.status.${record.status}`) }}
        </template>
        <template #optional="{ record }">
          <a-button
                  type="text"
                  size="small"
                  @click="edit(record)">
            <template #icon>
              <icon-edit />
            </template>
            编辑
          </a-button>
          <a-popconfirm
                  :content="`此操作将永久删除(${record.name}), 是否继续?`"
                  type="warning"
                  @ok="delPlateModule(record)"
          >
            <a-button
                    type="text"
                    size="small"
                    status="danger"
            >
              <template #icon>
                <icon-delete />
              </template>
              删除
            </a-button>
          </a-popconfirm>

          <a-button  type="text"
                     size="small" @click="handleClickAddNumber">修改数量</a-button>
          <a-modal v-model:visible="visibleAddNumber" @ok="handleOkAddNumber(record)" @cancel="handleCancelAddNumber">
            <template #title>
              修改数量
            </template>
            <div>
              修改数量<a-input v-model="AddNumber" :style="{width:'320px'}" placeholder="请输入数量" allow-clear
            />
            </div>
          </a-modal>

        </template>
      </a-table>
    </a-card>
    <MenuForm
            v-model:visible="formDialogVisible"
            :form-data="formData"
            :selected="platePartId"
    />
  </div>
</template>

<script lang="ts" setup>
  import { computed, ref, reactive, watch, nextTick,onMounted } from 'vue';
  import { FieldRule, Message } from '@arco-design/web-vue';
  import { useI18n } from 'vue-i18n';
  import useLoading from '@/hooks/loading';
  import {  PolicyRecord, PolicyParams,Pagination } from '@/api/production';

  import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
  import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
  import cloneDeep from 'lodash/cloneDeep';
  import Sortable from 'sortablejs';


  import MenuForm from './components/menu-form.vue';
  import {addPartCat, getAllPartList, partAddNumber, queryPartList} from "@/api/part";
  import {
    addProductionCat,
    deleteProductionCat,
    editProductionCat,
    getProductCatTree,
    queryProductionList
  } from "@/api/production";
  import {contentTypeOptionsCatPlateVersion, deletePlateModule, queryPlateModuleList} from "@/api/platemodule";
  import {
    contentTypeOptionsCatPlateVersionPart, deletePlateModulePart,
    plateModuleAddNumber,
    queryPlateModulePartList
  } from "@/api/platemodulepart";


  type SizeProps = 'mini' | 'small' | 'medium' | 'large';
  type Column = TableColumnData & { checked?: true };

  const generateFormModel = () => {
    return {
      selected:'T9',
      number: '',
      name: '',
      contentType: '',
      filterType: '',
      createdTime: [],
      status: '',
    };
  };
  const generateFormAdd = () => {
    return {
      selected:'',
      name: '',
      age: undefined,
      section: '',
    };
  };
  const { loading, setLoading } = useLoading(true);
  const { t } = useI18n();
  const renderDataPartList = ref([]);
  const formModel = ref(generateFormModel());
  const formAdd = ref(generateFormAdd());
  const cloneColumns = ref<Column[]>([]);
  const showColumns = ref<Column[]>([]);
const datatree=ref([]);

//修改数量
  const visibleAddNumber = ref(false);
  const AddNumber = ref();
  const handleClickAddNumber = () => {
    visibleAddNumber.value = true;
  };
  const handleOkAddNumber = async (data:any) => {
    console.log(data)
      const datainfo={
        id:data.id,
        number:AddNumber.value,
      }
      console.log(datainfo)
      await plateModuleAddNumber(datainfo).then(()=>{
        Message.success('添加库存成功');
      });
    visibleAddNumber.value = false;
  };
  const handleCancelAddNumber = () => {
    visibleAddNumber.value = false;
  }
  //减库存
  const visibleSubtractNumber = ref(false);
  const SubtractNumber = ref();
  const handleClickSubtractNumber = () => {
    visibleSubtractNumber.value = true;
  };
  const handleOkSubtractNumber = async (data:any) => {
    console.log(data)
    if(SubtractNumber.value>0){
      const datainfo={
        id:data.id,
        number:'-'+SubtractNumber.value,
      }
      console.log(datainfo)
      await partAddNumber(datainfo).then(()=>{
        Message.success('减少库存成功');
      });
    }else {
      Message.error('请输入大于0的数字');
    }
    visibleSubtractNumber.value = false;
  };
  const handleCancelSubtractNumber = () => {
    visibleSubtractNumber.value = false;
  }
  //删除列表信息
  const delPlateModule= async (data: any) => {
    console.log(data);
const dataInfo={
  id:data.id
}
    await deletePlateModulePart(dataInfo).then(() => {
      fetchData();
      Message.success('删除成功');
      console.log('删除成功');
    });
  };


  //分类钣金版本模块系列
  const plateVersion=ref();
  let contentTypeOptionsPlateData=[];
  const fieldNames = {value: 'id', label: 'version_name'}
  const contentTypeOptionsPlate = async () => {
    console.log('dasdasdas',selectedKey.value)
    const {data}=await contentTypeOptionsCatPlateVersion(selectedKey.value);
    if(data.data!=null){
      contentTypeOptionsPlateData=data.data;
    }
  }

  //分类钣金版本模块零件系列
  const platePartVersion=ref();
  let contentTypeOptionsPlatePartData=[];
  const fieldPartNames = {value: 'id', label: 'name'}
  const contentTypeOptionsPlatePart = async () => {
    console.log('aaaaaaaa',plateId.value)
    const {data}=await contentTypeOptionsCatPlateVersionPart(plateId.value);
    console.log(data)
    if(data!=null){
      contentTypeOptionsPlatePartData=data;
      console.log(contentTypeOptionsPlatePartData)
    }
  }


  //系列分类树选择
  onMounted(async () => {
    const Data = await getProductCatTree();
    datatree.value=changePart(Data.data);
    console.log('datatree', datatree)
    console.log(Data)
  })
//零件系列添加对话框
  const visiblePart = ref(false);
  const renderDataPart = ref();
  const formPart = reactive({
    name: '',
    pid: ''
  });
  const handleClick = () => {
    visiblePart.value = true;
    renderDataPart.value=datatree.value;
    console.log(renderDataPart)
  };
  const handleBeforeOk = async (done) =>{
    console.log(formPart)
    const dataInfo={
      pid:formPart.pid,
      cat_name:formPart.name
    }
    console.log(dataInfo)
    await addProductionCat(dataInfo).then(() => {
      Message.success("添加产品分类成功")
    });
    window.setTimeout(() => {
      done()
      // prevent close
      // done(false)
    }, 3000)
  };
  const handleCancel = () => {
    visiblePart.value = false;
  }

  //零件系列编辑对话框
  const visibleProductionEdit = ref(false);
  const renderDataProductionEdit = ref();
  const formProductionEdit = reactive({
    name: '',
    pid: ''
  });
  const handleClickProductionEdit = () => {
    visibleProductionEdit.value = true;
    renderDataProductionEdit.value=datatree.value;
    console.log(renderDataProductionEdit)
  };
  const handleBeforeOkProductionEdit = async (done) =>{

    const dataInfo={
      id:formProductionEdit.pid,
      cat_name:formProductionEdit.name
    }
    console.log(dataInfo)
    await editProductionCat(dataInfo).then(() => {
      Message.success("修改产品分类成功")
    });
    window.setTimeout(() => {
      done()
      // prevent close
      // done(false)
    }, 3000)
  };
  const handleCancelProductionEdit = () => {
    visibleProductionEdit.value = false;
  }

  //零件系列删除对话框
  const visibleProductionDelete = ref(false);
  const renderDataProductionDelete = ref();
  const formProductionDelete = reactive({
    pid: ''
  });
  const handleClickProductionDelete = () => {
    visibleProductionDelete.value = true;
    renderDataProductionDelete.value=datatree.value;
    console.log(renderDataProductionDelete)
  };
  const handleBeforeOkProductionDelete = async (done) =>{

    const dataInfo={
      id:formProductionDelete.pid,
    }
    console.log(dataInfo)
    await deleteProductionCat(dataInfo).then(() => {
      Message.success("删除产品分类成功")
    });
    window.setTimeout(() => {
      done()
      // prevent close
      // done(false)
    }, 3000)
  };
  const handleCancelProductionDelete = () => {
    visibleProductionDelete.value = false;
  }
  const treeData = [
    {
      title: 'Trunk 0-0',
      key: '0-0',
      children: [
        {
          title: 'Branch 0-0-0',
          key: '0-0-0',
          children: [
            {
              title: 'Leaf',
              key: '0-0-0-0',
            },
            {
              title: 'Leaf',
              key: '0-0-0-1',
            }
          ]
        },
        {
          title: 'Branch 0-0-1',
          key: '0-0-1',
          children: [
            {
              title: 'Leaf',
              key: '0-0-1-0',
            },
          ]
        },
      ],
    },
  ];

  //编辑添加按钮
  const formData = ref();
  console.log(formData);
  // 弹出框标记
  const formDialogVisible = ref(false);
  const add = () => {
    formData.value = {};
    formDialogVisible.value = true;
  };
  const edit = (e: any) => {

    formDialogVisible.value = true;

    formData.value = { ...e };


  };



  const size = ref<SizeProps>('medium');

  const basePagination: any = {
    current: 1,
    pageSize: 10,
    selected:1,
  };
  const pagination = reactive({
    ...basePagination,
  });
  const densityList = computed(() => [
    {
      name: t('searchTable.size.mini'),
      value: 'mini',
    },
    {
      name: t('searchTable.size.small'),
      value: 'small',
    },
    {
      name: t('searchTable.size.medium'),
      value: 'medium',
    },
    {
      name: t('searchTable.size.large'),
      value: 'large',
    },
  ]);
  const columns = computed<TableColumnData[]>(() =>  [
    {
      title: 'id',
      dataIndex: 'id',

    },
    {
      title: '零件名称',
      dataIndex: 'name',
    },

    {
      title: '零件数量',
      dataIndex: 'number',
    },
    {
      title: '操作',
      slotName: 'optional'
    }
  ]);
  const contentTypeOptions = computed<SelectOptionData[]>(() => [
    {
      label: t('searchTable.form.contentType.img'),
      value: 'img',
    },
    {
      label: t('searchTable.form.contentType.horizontalVideo'),
      value: 'horizontalVideo',
    },
    {
      label: t('searchTable.form.contentType.verticalVideo'),
      value: 'verticalVideo',
    },
  ]);
  const filterTypeOptions = computed<SelectOptionData[]>(() => [
    {
      label: t('searchTable.form.filterType.artificial'),
      value: 'artificial',
    },
    {
      label: t('searchTable.form.filterType.rules'),
      value: 'rules',
    },
  ]);
  const statusOptions = computed<SelectOptionData[]>(() => [
    {
      label: t('searchTable.form.status.online'),
      value: 'online',
    },
    {
      label: t('searchTable.form.status.offline'),
      value: 'offline',
    },
  ]);

  //渲染零件列表数据
  const fetchData = async (
          params = { current: 1, pageSize: 10,selected:1}
  ) => {
    setLoading(true);
    try {
      console.log(params);
      const { data } = await queryPlateModulePartList(params);
      console.log(data)
      console.log(data.value)
      console.log(data.data)
      renderDataPartList.value = data;
      console.log( renderDataPartList)
      console.log( renderDataPartList.value)
      pagination.current = 1;
      pagination.total = 10;
    } catch (err) {
      // you can report use errorHandler or other
console.log(err);
    } finally {
      setLoading(false);
    }
  };

  const selectedKey=ref();
  const text=ref();
  const onChange = (selected: number) => {
    console.log(selected, 212121212121);
    text.value = selected;
    selectedKey.value= selected;
    contentTypeOptionsPlate();
    // fetchData({ ...basePagination, selected });
  };

  const plateId=ref();
  const onPlateChange = (selected: number) => {
    console.log(selected, 8888888888888);
    plateId.value= selected;
    contentTypeOptionsPlatePart();
    // fetchData({ ...basePagination, selected });
  };
  const platePartId=ref();
  const onPlatePartChange = (selected: number) => {
    console.log(selected, 9999999999);
    platePartId.value= selected;
    fetchData({ ...basePagination, selected });
  };



  const search = () => {
    fetchData({
      ...basePagination,
      ...formModel.value,
    } as unknown as PolicyParams);
  };
  const onPageChange = (current: number) => {
    fetchData({ ...basePagination, current });
  };

  fetchData();
  const reset = () => {
    formModel.value = generateFormModel();
  };

  const handleSelectDensity = (
    val: string | number | Record<string, any> | undefined,
    e: Event
  ) => {
    size.value = val as SizeProps;
  };

  const handleChange = (
    checked: boolean | (string | boolean | number)[],
    column: Column,
    index: number
  ) => {
    if (!checked) {
      cloneColumns.value = showColumns.value.filter(
        (item) => item.dataIndex !== column.dataIndex
      );
    } else {
      cloneColumns.value.splice(index, 0, column);
    }
  };

  const exchangeArray = <T extends Array<any>>(
    array: T,
    beforeIdx: number,
    newIdx: number,
    isDeep = false
  ): T => {
    const newArray = isDeep ? cloneDeep(array) : array;
    if (beforeIdx > -1 && newIdx > -1) {
      // 先替换后面的，然后拿到替换的结果替换前面的
      newArray.splice(
        beforeIdx,
        1,
        newArray.splice(newIdx, 1, newArray[beforeIdx]).pop()
      );
    }
    return newArray;
  };

  const popupVisibleChange = (val: boolean) => {
    if (val) {
      nextTick(() => {
        const el = document.getElementById('tableSetting') as HTMLElement;
        const sortable = new Sortable(el, {
          onEnd(e: any) {
            const { oldIndex, newIndex } = e;
            exchangeArray(cloneColumns.value, oldIndex, newIndex);
            exchangeArray(showColumns.value, oldIndex, newIndex);
          },
        });
      });
    }
  };

  watch(
    () => columns.value,
    (val) => {
      cloneColumns.value = cloneDeep(val);
      cloneColumns.value.forEach((item, index) => {
        item.checked = true;
      });
      showColumns.value = cloneDeep(cloneColumns.value);
    },
    { deep: true, immediate: true }
  );
//数选择的数据格式转换
  function changePart(menuList:any) {
    return menuList?.map((item) => {
              const {
                id,
                pid,
                cat_name,
              }=item;
              console.log(item.cat_name);
              const son = item.son ?? [];
              const isChild = son != null && son.length !== 0;
              const currentArray: any = {
                key:id,
                pid:pid,
                title:cat_name,
                children: [],
              }
              // 是否有子菜单，并递归处理
              if (isChild) {
                currentArray.children = changePart(
                        son,
                );
              }
              return currentArray;
            }
    )
  }
</script>

<script lang="ts">
  export default {
    name: 'SearchTable',

    // data() {
    //   return {
    //     selected: 'T91',
    //   }
    // },

    /*setup() {
      const selected = ref('1');
      return {
        selected,
      };
    },*/

    // watch:{
    //   selected(newVal){
    //     console.log(newVal);
    //   }
    // }
  };
</script>

<style scoped lang="less">
  .container {
    padding: 0 20px 20px 20px;
  }
  :deep(.arco-table-th) {
    &:last-child {
      .arco-table-th-item-title {
        margin-left: 16px;
      }
    }
  }
  .action-icon {
    margin-left: 12px;
    cursor: pointer;
  }
  .active {
    color: #0960bd;
    background-color: #e3f4fc;
  }
  .setting {
    display: flex;
    align-items: center;
    width: 200px;
    .title {
      margin-left: 12px;
      cursor: pointer;
    }
  }
</style>
